import java.util.Scanner;

public class Homework4 {
    public static void main(String[]args){
        Scanner a=new Scanner(System.in);
        System.out.println("请输入一个五位数");
        int num=a.nextInt();
        System.out.println("输出的五位数是"+num);
        int num1=num/10000;
        System.out.println("输出的万位数是"+num1);
        int num2=num/1000%10;
        System.out.println("输出的千位数是"+num2);
        int num3=num/100%10;
        System.out.println("输出的百位数是"+num3);
        int num4=num/10%10;
        System.out.println("输出的十位数是"+num4);
        int num5=num%10;
        System.out.println("输出的个位数是"+num5);
        int sum=num1+num2+num3+num4+num5;
        System.out.println("和为"+sum);
    }
}
